import urllib
import urllib2
from lxml import etree

class CsdnLoader(urllib.FancyURLopener):
    version = "Mozilla/5.0 (Windows; U; Windows NT 5.1; it; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11"

url = "http://blog.csdn.net/lizhongkan"
loader = CsdnLoader()
text = loader.open(url).read()
#print text

html = etree.HTML(text)

spans = html.xpath("//span[@class='link_title']/a[@title]")
for a in spans:
    print a.text

#print spans
